key_pressed=get(gcf,'currentcharacter');


switch key_pressed
    case 's'
        file_tag=input('Saving figure (leave blank to cancel). Label file as: ','s');
        if ~isempty(file_tag)
            %print(gcf,'-djpeg','C:\tmp\testing.jpg');
            figure(1002);
        end
    case 'g' % get frames
        timepoint=ginput(1);
        timepoint=round(timepoint(1));
        [~,curr_iframe]=min(abs(iframe_times-timepoint));
        [~,curr_frame]=min(abs(frame_times-timepoint));
        disp(['current stack frame ' num2str(curr_frame)])
        disp(['current eye frame ' num2str(curr_iframe)])
end